package org.hxzon.rpggame.admcmd;

import io.netty.channel.ChannelHandlerContext;

import org.hxzon.rpggame.core.AdmCmd;
import org.hxzon.rpggame.core.impl.AbstractAdmCmdImpl;
import org.hxzon.util.StringParser;

public class EchoAdmCmd extends AbstractAdmCmdImpl implements AdmCmd {

    public EchoAdmCmd() {
        super("echo");
    }

    @Override
    public void execute(StringParser cmdLine, ChannelHandlerContext ctx) {
        ctx.writeAndFlush(cmdLine.remainString());
    }

    @Override
    public String usage() {
        return getName() + " <str>";
    }
}
